import { Route } from 'react-router'
import {IndexRedirect} from 'react-router';
import { WeaErrorPage ,WeaLocaleProvider } from 'ecCom'

import stores from './stores';

import './style/index';
import './util/index'

import Home from './components/Home'
import MyCapital from "./components/MyCapital"
import Instock from './components/capitalInstock/Instock'
import InstockCheck from './components/capitalInstockCheck/InstockCheck'
import CptManager from "./components/capitalManager/CptManager.js"
import Search from "./components/search/Search.js"
import SearchResult from "./components/search/SearchResult.js"
import CptCard from './components/capital/CptCard'
import CptCard1 from './components/capital/CptCard1'

import CapitalReport from "./components/report/CapitalReport"
import CptCondition from  "./components/report/CptCondition"
import CptConditionResult from  "./components/report/CptConditionResult"
import FlowCondition from  "./components/report/FlowCondition"
import FlowConditionResult from  "./components/report/FlowConditionResult"
import CptInventoryPlanList from './components/inventory/CptInventoryPlanList';
import MyCptInventoryList from './components/inventory/MyCptInventoryList';
import InventoryRemind from './components/remind/InventoryRemind';
import JournalList from './components/journal/JournalList';
import JournalEdit from './components/journal/JournalEdit';

window.cpt_store = stores;

class Error extends React.Component {
    render() { 
      return (
        <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@y15ttk`} msg="对不起，无法找到该页面！" />
      )
    }
}

const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'cpt');
const  Routes = (
    <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@pfkuns`} path="cpt" name="cpt"  onEnter={getLocaleLabel}  breadcrumbName="资产" component={Home}>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@1eheb6`} name="mycapital" path="mycapital" breadcrumbName="我的资产" component={ MyCapital }/>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@bc4skq`} name="instock" path="instock" breadcrumbName="入库申请" component={ Instock }/>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@a92rw0`} name="instockcheck" path="instockcheck" breadcrumbName="入库验收" component={ InstockCheck }/>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@7d966h`} name="cptmanager" path="cptmanager/:viewtype" breadcrumbName="管理资产" component={ CptManager }/>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@da0g7p`} name="search" path="search/:isdata" breadcrumbName="查询资产（资产资料）" component={ Search }/>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@io8dgb`} name="searchResult" path="searchResult" breadcrumbName="查询资产（资产资料）结果" component={ SearchResult }/>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@debtky`} name="cptcard" path="cptcard" breadcrumbName="资产卡片" component={ CptCard }/>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@rx0u35`} name="cptcard1" path="cptcard1" breadcrumbName="资产资料卡片" component={ CptCard1 }/>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@zdhilq`} name="cptInventoryPlanList" path="cptInventoryPlanList"  breadcrumbName="盘点计划" component={CptInventoryPlanList} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@6e4pzo`} name="myCptInventoryList" path="myCptInventoryList"  breadcrumbName="我的盘点表" component={MyCptInventoryList} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@blelux`} name="report" path="report" breadcrumbName="资产报表" >
            <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@ex7kaz`} name="cptCondition" path="cptCondition" breadcrumbName="资产情况" component={ CptCondition }/>
            <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@fdfox3`} name="cptConditionResult" path="cptConditionResult" breadcrumbName="资产情况结果" component={ CptConditionResult }/>
            <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@6fpasv`} name="flowCondition" path="flowCondition" breadcrumbName="流转情况" component={ FlowCondition }/>
            <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@eaarho`} name="flowConditionResult" path="flowConditionResult" breadcrumbName="流转情况结果" component={ FlowConditionResult }/>
            <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@7vu036`} name="reptype" path=":reptype" component={CapitalReport}/>
        </Route>
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@x80qqi`} name="InventoryRemind" path="InventoryRemind"  breadcrumbName="低库存预警" component={InventoryRemind} />
        <Route name="JournalList" path="JournalList/:kwlx"  breadcrumbName="刊物列表" component={JournalList} />
        <Route name="JournalEdit" path="JournalEdit"  breadcrumbName="刊物编辑" component={JournalEdit} />
        <Route ecId={`${this && this.props && this.props.ecId || ''}_Route@ba728b`} path="*" component={Error}></Route>
    </Route>
    );

module.exports =  {
    Route:Routes,
    store:stores,
}